Super-fork: cherry-pick features from 8 community forks - #253
Conversation
Cherry-picks all unique features from FarelRA, hnewcity, BcGee, Yorick-Ryu, severity1, gaoshan5211, Echoxiawan, and leikaiwei forks. Changes: - Account system: Circuit Breaker, sticky behavior, lazy init, multi-account - API region: auto-detection from profile ARN with env-var override - Auth: support for social login (Google/GitHub) and Enterprise Kiro IDE - Config: ACCOUNTS_CONFIG_FILE, MODEL_CACHE_TTL, PROXY_AUTH_DISABLED - Converters: responses API format, document/PDF extraction, thinking blocks - Debug logger: per-request archival, mode=all/mode=errors - Extensions: tool name aliasing system - HTTP: SOCKS5 proxy support, connection timeout detection - Models: dynamic resolution, fallback models, hidden model support - Parsers: inverted model names support, Cursor flat format - Profile ARN: centralized profile_arn_for_payload() helper - Routes: /v1/responses endpoint, /v1/usage endpoint, PROXY_AUTH_DISABLED - Streaming: first-token timeout with retry for both APIs - Token counting with tiktoken - Truncation recovery system - Network error classification with user-friendly messages - PDF text extraction from document content blocks (both APIs) - Live model catalog refresh on /v1/models endpoint - Content-Type: migrated from x-amz-json-1.0 to application/json Fixes: - Session fixture: set OS env vars so config module reloads preserve temp credential paths (fixes 79 test errors in full-suite runs) - All 1673 unit tests passing
…ning - Fix 3 async generator warnings by using real timeouts instead of patching asyncio.wait_for (avoids unawaited coroutines) - Add gen.aclose() cleanup in all 3 affected tests - Suppress StarletteDeprecationWarning in conftest.py (httpx2 not yet available in starlette 1.3.1) - Remove stale pytest.ini filterwarnings that were not matching - 1673 tests pass with 0 warnings
|
Thanks for the PR! 🎉 Before merge, we need a one-time CLA confirmation. Full CLA text: Please reply once with: You need to write once, all further messages from me can be ignored. |
…talog
Replace the hardcoded native-reasoning tables with per-model schemas fetched
from the Kiro control plane. ListAvailableModels on management.{region}.kiro.dev
advertises each model's additionalModelRequestFieldsSchema, which declares whether
the model supports native adaptive thinking and exactly which effort levels it
accepts. Binding to that ground truth fixes two problems in the static approach:
requesting native effort on models that don't support it, and sending effort
values (e.g. "xhigh") outside the server's strict enum.
- kiro/native_reasoning.py: new registry that parses each model's advertised
additionalModelRequestFieldsSchema into an effort descriptor (schema type,
valid effort enum, default) and clamps a requested effort onto the advertised
set (xhigh -> max when the model only offers low/medium/high/max).
- account_manager: fetch the catalog from the control plane (management host,
ListAvailableModels JSON-1.0 RPC) for all accounts, including runtime-endpoint
ones, and register the advertised schemas on init and TTL refresh. Falls back
to static models on failure. Removes the runtime-endpoint fetch short-circuit.
- converters_core.build_native_effort_fields: consult the catalog registry first
(static config table only as fallback) and clamp effort to the advertised enum.
- auth: add management_host; config: point KIRO_MANAGEMENT_HOST_TEMPLATE at
management.{region}.kiro.dev; http_client: allow per-request extra_headers so
the catalog RPC can set its x-amz-target.
Verified live against a Kiro subscription: management host returns HTTP 200 for
origin=AI_EDITOR, and only claude-opus-4.6/sonnet-4.6 advertise effort
(low/medium/high/max), which the registry picks up automatically.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018gszhX9bogSALZ4S9AR1Vq
|
Nice work consolidating the forks. I built a follow-up on top of this branch that makes the native reasoning path catalog-driven instead of relying on the hardcoded The Kiro control plane (
Verified live: the management host returns |
feat(reasoning): drive native reasoning effort from the live model catalog
|
Thanks for the PR! 🎉 Before merge, we need a one-time CLA confirmation. Full CLA text: Please reply once with: You need to write once, all further messages from me can be ignored. |
|
I have read the CLA and I accept its terms |
|
I have read the CLA and I accept its terms |
|
@cla-bot check |
|
Thanks for the PR! 🎉 Before merge, we need a one-time CLA confirmation. Full CLA text: Please reply once with: You need to write once, all further messages from me can be ignored. |
|
The cla-bot has been summoned, and re-checked this pull request! |
Summary
Super-fork that cherry-picks all unique features from 8 community forks (FarelRA, hnewcity, BcGee, Yorick-Ryu, severity1, gaoshan5211, Echoxiawan, leikaiwei) into a single clean codebase.
New features cherry-picked:
extensions/tool_name_alias.py) — configurable tool name remappingkiro/profile_arn.py) — centralized profile ARN with fallbackhttpx[socks]Bug fixes applied:
Quality:
profile_arn_for_payload()centralized and wired across all 4 route filesPROXY_AUTH_DISABLEDwired into both OpenAI and Anthropic auth/v1/modelsapplication/json